home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / marxmenu.arc / SAMPLE2.MNU < prev    next >
Text File  |  1991-03-27  |  6KB  |  321 lines

  1. Comment
  2. =====================================================================
  3.  
  4. This is an example of a more complex menu system. It shows how the
  5. commands are used. Print this out and study it. Some of these examples
  6. assume that you own the Computer Tyme DOS Toolbox
  7.  
  8. =====================================================================
  9. EndComment
  10.  
  11. Var
  12.    ForeColor BackColor ClearChar
  13.    %ExecSt %BackupPath %Option %Message FileType
  14.  
  15. Procedure SelectFile
  16.   BoxHeaderColor ForeColor BackColor
  17.   BoxBorderColor Cyan Mag
  18.   BoxInsideColor Yellow Mag
  19.   InverseColor Yellow Red
  20.   %ExecSt = PickFile FileType 4 5 17
  21. EndProc
  22.  
  23. if ColorScreen
  24.   Shadow On
  25.   ForeColor = Yellow
  26.   BackColor = Mag
  27.   ClearChar = 32
  28. else
  29.   Shadow Off
  30.   ForeColor = Black
  31.   BackColor = Grey
  32.   ClearChar = 177
  33. endif
  34.  
  35. Explode
  36. SavePosition On
  37. BlockBox
  38. BoxHeaderColor ForeColor BackColor
  39. BoxBorderColor Green Blue
  40. BoxInsideColor Yellow Blue
  41. InverseColor Yellow Red
  42. ConsoleHeaderColor ForeColor BackColor
  43. ConsoleBorderColor Yellow Green
  44. ConsoleInsideColor LCyan Green
  45. BlankTime = 10
  46. BlankMessage = 'Out to Lunch'
  47.  
  48. TextColor Red Red
  49. ClearScreen ClearChar
  50.  
  51. TextColor ForeColor BackColor
  52. ClearLine
  53. Write '  * The MarxMenu System *'
  54.  
  55. GotoXY 1 25
  56. ClearLine
  57. WriteCenter 'Copyright 1989-90 by Marc Perkel * All Rights Reserved'
  58.  
  59. ClockColor ForeColor BackColor
  60. ClockPos 35 1
  61.  
  62. TextColor Yellow Blue
  63. DrawBox 25 11 30 3
  64. WriteCenter 'MarxMenu Demonstration'
  65.  
  66. Loop 7
  67.    MoveWindow 0 -1
  68. EndLoop
  69.  
  70. DrawBox 29 11 22 3
  71. WriteCenter 'Press ESC to Exit'
  72.  
  73. Loop 9
  74.    MoveWindow 0 1
  75. EndLoop
  76.  
  77. BoxHeader = ' My Master Menu '
  78. DrawBox 14 9 53 9
  79. UseArrows
  80. TextColor LCyan Blue
  81. ClearLine 205
  82. TextColor Yellow Blue
  83. Writeln
  84. Writeln '   A - Run Another Menu    G - Pick Directory'
  85. Writeln '   B - DM                  H - Execute File Menu'
  86. Writeln '   C - Dos Shell           I - Directory'
  87. Writeln '   D - Marx NIM            J - Backup Files'
  88. Writeln '   E - Edit SAMPLE2.MNU    K - Free Space'
  89. Write   '   F - Edit Files          L - Format Menu'
  90.  
  91. OnKey 'A'
  92.   |BoxHeaderColor ForeColor BackColor
  93.   |BoxBorderColor Yellow Green
  94.   |BoxInsideColor White Green
  95.   |%ExecSt = PickFile '*.MNU' 4 5 17
  96.   |KeySave = ''
  97.   Marx %ExecSt
  98.  
  99. OnKey 'B'
  100.   DropTo DM
  101.  
  102. OnKey 'C'
  103.   |PassWord('shell',4,4)  ;The numbers define where the password box appears
  104.   |If ExistOnPath('DOLIST.EXE') > ''
  105.   |  %ExecSt = 'DoList'
  106.   |Else
  107.   |  %ExecSt = 'Command'
  108.   |Endif
  109.   DropTo %ExecSt
  110.  
  111. OnKey 'D'
  112.   Marx NIM
  113.  
  114. OnKey 'E'
  115.   TEDIT %MenuFileName
  116.  
  117. OnKey 'F'
  118.   ^Edit
  119.  
  120. OnKey 'G'
  121.   PD
  122.  
  123. OnKey 'H'
  124.   ^Exec
  125.  
  126. OnKey 'I'
  127.   |if ExistOnPath('D.EXE') > ''
  128.   |  %ExecSt = 'D'
  129.   |else
  130.   |  %ExecSt = 'DIR/W|MORE'
  131.   |endif
  132.   %ExecSt
  133.   Pause
  134.  
  135. OnKey 'J'
  136.   ^Backup
  137.  
  138. OnKey 'K'
  139.   |if ExistOnPath('FREE.EXE') > ''
  140.   |  %ExecSt = 'FREE'
  141.   |else
  142.   |  %ExecSt = 'CHKDSK'
  143.   |endif
  144.   %ExecSt
  145.   Pause
  146.  
  147. OnKey 'L'
  148.   ^Format
  149.  
  150. OnKey 'Z'
  151.   |%ExecSt = SelectPath
  152.  
  153.  
  154. :Exec
  155. BoxHeaderColor ForeColor BackColor
  156. BoxBorderColor Yellow Green
  157. BoxInsideColor LCyan Green
  158. InverseColor Yellow Red
  159. BoxHeader = ' Execute Menu '
  160. DrawBox 45 16 25 6
  161. UseArrows
  162. ClearLine 205
  163. Writeln
  164. Writeln '  1 - Run COM Program'
  165. Writeln '  2 - Run EXE Program'
  166. Write   '  3 - Run BAT Program' ;Notice that MarxMenu will execute BAT files!
  167.  
  168. OnKey '1'
  169.   |FileType = '*.COM'
  170.   |SelectFile
  171.   @Echo Executing %ExecSt
  172.   %ExecSt
  173.  
  174. OnKey '2'
  175.   |FileType = '*.EXE'
  176.   |SelectFile
  177.   @Echo Executing %ExecSt
  178.   %ExecSt
  179.  
  180. OnKey '3'
  181.   |FileType = '*.BAT'
  182.   |SelectFile
  183.   @Echo Executing %ExecSt
  184.   %ExecSt
  185.  
  186.  
  187. :Edit
  188. BoxHeaderColor ForeColor BackColor
  189. BoxBorderColor Yellow Green
  190. BoxInsideColor LCyan Green
  191. InverseColor Yellow Red
  192. BoxHeader = ' Edit Menu '
  193. DrawBox 47 16 25 6
  194. UseArrows
  195. ClearLine 205
  196. Writeln
  197. Writeln '  1 - Edit DOC File'
  198. Writeln '  2 - Edit TXT File'
  199. Write   '  3 - Edit MNU File'
  200.  
  201. OnKey '1'
  202.   |FileType = '*.DOC'
  203.   |SelectFile
  204.   TEDIT %ExecSt
  205.  
  206. OnKey '2'
  207.   |FileType = '*.TXT'
  208.   |SelectFile
  209.   TEDIT %ExecSt
  210.  
  211. OnKey '3'
  212.   |FileType = '*.MNU'
  213.   |SelectFile
  214.   TEDIT %ExecSt
  215.  
  216.  
  217. :FORMAT
  218. BoxHeaderColor ForeColor BackColor
  219. BoxBorderColor Yellow Green
  220. BoxInsideColor White Green
  221. BoxHeader = ' Format Floppy Disk Menu '
  222. DrawBox 25 13 44 7
  223. TextColor Yellow Green
  224. ClearLine 205
  225. UseArrows
  226. TextColor White Green
  227. Writeln
  228. Writeln '  1 - Format 360      5 - Format /S 360'
  229. Writeln '  2 - Format 1.2M     6 - Format /S 1.2M'
  230. Writeln '  3 - Format 720      7 - Format /S 720'
  231. Write   '  4 - Format 1.4M     8 - Format /S 1.4M'
  232.  
  233. OnKey '1'
  234.   |%Message = '360k Format with no System Files.'
  235.   |%Option = '/4'
  236.   |Format2
  237.  
  238. OnKey '2'
  239.   |%Message = '1.2m Format with no System Files.'
  240.   |%Option = ''
  241.   |Format2
  242.  
  243. OnKey '3'
  244.   |%Message = '720k Format with no System Files.'
  245.   |%Option = '/N:9/T:80'
  246.   |Format2
  247.  
  248. OnKey '4'
  249.   |%Message = '1.4m Format with no System Files.'
  250.   |%Option = '/N:18/T:80'
  251.   |Format2
  252.  
  253. OnKey '5'
  254.   |%Message = '360k Format with System Files.'
  255.   |%Option = '/4/S'
  256.   |Format2
  257.  
  258. OnKey '6'
  259.   |%Message = '1.2m Format with System Files.'
  260.   |%Option = '/S'
  261.   |Format2
  262.  
  263. OnKey '7'
  264.   |%Message = '720k Format with System Files.'
  265.   |%Option = '/N:9/T:80/S'
  266.   |Format2
  267.  
  268. OnKey '8'
  269.   |%Message = '1.4m Format with System Files.'
  270.   |%Option = '/N:18/T:80/S'
  271.   |Format2
  272.  
  273. :Format2
  274. BoxBorderColor LCyan Blue
  275. BoxInsideColor Grey Blue
  276. BoxHeader = ' Drive '
  277. DrawBox 54 17 11 5
  278. TextColor LCyan Blue
  279. ClearLine 205
  280. TextColor Grey Blue
  281. UseArrows
  282. Writeln
  283. Writeln '  A:'
  284. Write   '  B:'
  285.  
  286. OnKey 'A'
  287.   @Echo Formatting Drive A: %Message
  288.   @Echo To abort, press CTRL-C.
  289.   @Echo .
  290.   FORMAT A:%Option
  291.  
  292. OnKey 'B'
  293.   @Echo Formatting Drive B: %Message
  294.   @Echo To abort, press CTRL-C.
  295.   @Echo .
  296.   FORMAT B:%Option
  297.  
  298.  
  299. :Backup
  300. BoxBorderColor LCyan Blue
  301. BoxInsideColor Grey Blue
  302. BoxHeader = ' Backup Hard Disk '
  303. DrawBox 44 17 22 5
  304. TextColor LCyan Blue
  305. ClearLine 205
  306. TextColor Grey Blue
  307. UseArrows
  308. Writeln
  309. Writeln '  Entire Disk'
  310. Write   '  One Directory'
  311.  
  312. OnKey 'E'
  313.   CD\
  314.   BACKUP C: A:/S
  315.  
  316. OnKey 'O'
  317.   |%BackupPath = SelectPath
  318.   CD %BackupPath
  319.   BACKUP C: A:
  320.  
  321.